﻿using IM.Easy.Entity.System;
using IM.Easy.Infrastructure.Query;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.SystemServices.Dtos
{

    /// <summary>
    /// 字典数据DTO
    /// </summary>
    public class DictDataDto
    {
        public long Id { get; set; }
        /// <summary>
        /// 字典标签
        /// </summary>
        [Required(ErrorMessage = "字典标签不能为空")]
        public string Label { get; set; }
        /// <summary>
        /// 字典键值
        /// </summary>
        [Required(ErrorMessage = "字典键值不能为空")]
        public string Value { get; set; }
        /// <summary>
        /// 字典类型
        /// </summary>
        [Required(ErrorMessage = "字典类型不能为空")]
        public string Group { get; set; }
        /// <summary>
        /// 样式属性（其他样式扩展）
        /// </summary>
        public string CssClass { get; set; }

        /// <summary>
        /// 表格回显样式  文本和标签样式
        /// </summary>
        public string ListClass { get; set; }

        /// <summary>
        /// 主题样式（仅针对标签有效）
        /// </summary>
        public string ThemeClass { get; set; }

        /// <summary>
        /// 显示顺序
        /// </summary>
        public int Order { get; set; }

        /// <summary>
        /// 是否系统内置
        /// </summary>
        public bool IsSystem { get; set; }

        /// <summary>
        /// 启用状态
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 数据类型
        /// </summary>
        public ValueDataType DataType { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }
    }

    public class DictDataGroupDto
    {
        public string DictType { get; set; }

        /// <summary>
        /// 数据类型
        /// </summary>
        public ValueDataType DataType { get; set; }

        public string DictTypeName { get; set; }

        public List<DictDataDto> Data { get; set; }

    }

    /// <summary>
    /// 字典数据查询DTO
    /// </summary>
    public class DictDataQueryDto : QueryBase
    {
        /// <summary>
        /// 字典类型
        /// </summary>
        public string Group { get; set; }

        /// <summary>
        /// 文本
        /// </summary>
        public string Label { get; set; }
    }
}
